import request from '@/config/axios'

// 装托机 VO
export interface MountingVO {
  id: number // id
  deviceId: string // 设备编号
  name: string // 设备名称
  description: string // 描述
  status: number // 状态
}

// 装托机 API
export const MountingApi = {
  // 查询装托机分页
  getMountingPage: async (params: any) => {
    return await request.get({ url: `/farm/mounting/page`, params })
  },

  // 查询装托机详情
  getMounting: async (id: number) => {
    return await request.get({ url: `/farm/mounting/get?id=` + id })
  },

  // 新增装托机
  createMounting: async (data: MountingVO) => {
    return await request.post({ url: `/farm/mounting/create`, data })
  },

  // 修改装托机
  updateMounting: async (data: MountingVO) => {
    return await request.put({ url: `/farm/mounting/update`, data })
  },

  // 删除装托机
  deleteMounting: async (id: number) => {
    return await request.delete({ url: `/farm/mounting/delete?id=` + id })
  },

  // 导出装托机 Excel
  exportMounting: async (params) => {
    return await request.download({ url: `/farm/mounting/export-excel`, params })
  },
}